﻿<!DOCTYPE html>
<!--HTML5 doctype-->
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>账户余额 - {site.name}</title>
<link rel="stylesheet" type="text/css" href="<%templateskin%>/jqmobi/css/icons.css" />
<link rel="stylesheet" type="text/css" href="<%templateskin%>/jqmobi/css/af.ui.base.css" />
<link rel="stylesheet" type="text/css" href="<%templateskin%>/css/style.css" />
<link rel="stylesheet" type="text/css" href="{config.webpath}scripts/artdialog/ui-dialog.css" />
<!--jqMobi主JS-->
<script type="text/javascript" charset="utf-8" src="{config.webpath}scripts/jquery/jquery-1.11.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="<%templateskin%>/jqmobi/jq.appframework.js"></script>
<script type="text/javascript" charset="utf-8" src="<%templateskin%>/jqmobi/ui/appframework.ui.js"></script>
<!--jqMobi插件-->
<script type="text/javascript" charset="utf-8" src="<%templateskin%>/jqmobi/plugins/jq.slidemenu.js"></script>
<script type="text/javascript" charset="utf-8" src="{config.webpath}scripts/artdialog/dialog-plus-min.js"></script>
<script type="text/javascript" charset="utf-8" src="<%templateskin%>/js/base.js"></script>
<script type="text/javascript">
	$(document).ready(function(e) {
        $(".page-list a").attr("data-ignore",true);
    });
</script>
</head>

<body>
<div id="afui">
  <div id="content">

	<div id="mainPanel" class="panel">
    <%if(action=="recharge")%>
    <!--账户余额-->
      <script type="text/javascript" src="{config.webpath}scripts/jquery/Validform_v5.3.2_min.js"></script>
      <script type="text/javascript">
		$(function(){
			AjaxInitForm('#recharge_form', '#btnSubmit', 0);
		});
	  </script>
      <header>
        <a href="javascript:;" onclick="history.back(-1);" class="backButton">返回</a>
        <h1>帐户余额</h1>
        <a onclick="$.ui.toggleSideMenu()" class="menuButton"></a>
      </header>
      <form id="recharge_form" name="recharge_form" url="{config.webpath}tools/submit_ajax.ashx?action=user_amount_recharge&site={site.build_path}">
        <div class="form-box">
          <dl>
            <dt>账户余额</dt>
            <dd>￥{userModel.amount}</dd>
          </dl>
          <div><input name="order_amount" id="order_amount" type="text" placeholder="请输入金额(元)" datatype="n"  nullmsg="请输入金额" sucmsg=" " /></div>
          <div><select name="payment_id" id="payment_id" datatype="*"  nullmsg="请选择支付方式" sucmsg=" ">
            <option value="">付款方式</option>
            <%set DataTable pay_list=get_payment_list(0, "type=1 and id>2 and (is_mobile=0 or is_mobile=2)")%> <!--取得一个DataTable-->
            <%foreach(DataRow dr in pay_list.Rows)%>
            <option value="{dr[id]}">{dr[title]}</option>
            <%/foreach%>
          </select>
          </div>
          <div><input id="btnSubmit" name="btnSubmit" type="submit" value="确认充值" class="btn orange full" /></div>
        </div>
      </form>
      
      <!--版权信息-->
      <%template src="_copyright.html"%>
      <!--/版权信息-->
      
      <!--底部导航-->
      <footer>
        <a href="<%linkurl("useramount","recharge")%>" data-ignore="true" class="icon settings pressed">账户充值</a>
        <a href="<%linkurl("useramount","log")%>" data-ignore="true" class="icon clock">充值记录</a>
        <a href="<%linkurl("useramount","list")%>" data-ignore="true" class="icon clock">收支明细</a>
      </footer>
      <!--/底部导航-->
    <!--/账户余额-->
    
    <%else if(action=="log")%>
    <!--充值记录-->
      <script type="text/javascript">
		  function ExecPostBack(checkValue) {
			  if (arguments.length == 1) {
				  ExecDelete('{config.webpath}tools/submit_ajax.ashx?action=user_recharge_delete', checkValue, '#turl');
			  }else{
				  var valueArr = '';
				  $("input[name='checkId']:checked").each(function(i){
					  valueArr += $(this).val();
					  if(i < $("input[name='checkId']:checked").length - 1){
						  valueArr += ","
					  }
				  });
				  ExecDelete('{config.webpath}tools/submit_ajax.ashx?action=user_recharge_delete', valueArr, '#turl');
			  }
		  }
	  </script>
      <header>
        <a href="javascript:;" onclick="history.back(-1);" class="backButton">返回</a>
        <h1>充值记录</h1>
        <a onclick="$.ui.toggleSideMenu()" class="menuButton"></a>
      </header>
      
      <!--操作按钮-->
      <div class="select-bar">
        <div class="col">
          <a href="javascript:;" onclick="checkAll(this);" class="icon-check">全选</a>
        </div>
        <div class="col">
          <a href="javascript:;" onclick="ExecPostBack();" class="icon-trash">删除</a>
        </div>
      </div>
      <!--/操作按钮-->
      
      <div>
        <ul class="detail-list">
          <%set DataTable rechargeList=get_user_recharge_list(10, page, "user_id="+userModel.id, out totalcount)%> <!--取得一个DataTable-->
          <%set string pagelist=get_page_link(10, page, totalcount, "useramount", action, "__id__")%> <!--取得分页页码列表-->
          <%foreach(DataRow dr in rechargeList.Rows)%>
          <li>
            <input id="checkId-{dr[id]}" name="checkId" class="checkall" type="checkbox" value="{dr[id]}" >
            <label for="checkId-{dr[id]}">
              <h4>
                <span>
                <%if({strtoint({dr[amount]})}>0)%>
                  +{dr[amount]}
                <%else%>
                  {dr[amount]}
                <%/if%>
                </span>
                <%=get_payment_title({strtoint({dr[payment_id]})})%>：{dr[recharge_no]}
              </h4>
              <p><span>
              <%if({strtoint({dr[status]})}>0)%>
                已完成
              <%else%>
                未完成
              <%/if%>
              </span>{dr[add_time]}</p>
            </label>
          </li>
          <%/foreach%>
        </ul>
      </div>
      <input id="turl" type="hidden" value="<%linkurl("useramount","log")%>" /><!--存在跳转的URL值-->
      
      <!--分页页码-->
      <div class="page-list">{pagelist}</div>
      <!--/分页页码-->
      
      <!--版权信息-->
      <%template src="_copyright.html"%>
      <!--/版权信息-->
      
      <!--底部导航-->
      <footer>
        <a href="<%linkurl("useramount","recharge")%>" data-ignore="true" class="icon settings">账户充值</a>
        <a href="<%linkurl("useramount","log")%>" data-ignore="true" class="icon clock pressed">充值记录</a>
        <a href="<%linkurl("useramount","list")%>" data-ignore="true" class="icon clock">收支明细</a>
      </footer>
      <!--/底部导航-->
    <!--/充值明细-->
    
    <%else if(action=="list")%>
    <!--收支明细-->
      <script type="text/javascript">
		  function ExecPostBack(checkValue) {
			  if (arguments.length == 1) {
				  ExecDelete('{config.webpath}tools/submit_ajax.ashx?action=user_amount_delete', checkValue, '#turl');
			  }else{
				  var valueArr = '';
				  $("input[name='checkId']:checked").each(function(i){
					  valueArr += $(this).val();
					  if(i < $("input[name='checkId']:checked").length - 1){
						  valueArr += ","
					  }
				  });
				  ExecDelete('{config.webpath}tools/submit_ajax.ashx?action=user_amount_delete', valueArr, '#turl');
			  }
		  }
	  </script>
      <header>
        <a href="javascript:;" onclick="history.back(-1);" class="backButton">返回</a>
        <h1>收支明细</h1>
        <a onclick="$.ui.toggleSideMenu()" class="menuButton"></a>
      </header>
      
      <!--操作按钮-->
      <div class="select-bar">
        <div class="col">
          <a href="javascript:;" onclick="checkAll(this);" class="icon-check">全选</a>
        </div>
        <div class="col">
          <a href="javascript:;" onclick="ExecPostBack();" class="icon-trash">删除</a>
        </div>
      </div>
      <!--/操作按钮-->
      
      <div>
        <ul class="detail-list">
          <%set DataTable amountList=get_user_amount_list(10, page, "user_id="+userModel.id, out totalcount)%> <!--取得一个DataTable-->
          <%set string pagelist=get_page_link(10, page, totalcount, "useramount", action, "__id__")%> <!--取得分页页码列表-->
          <%foreach(DataRow dr in amountList.Rows)%>
          <li>
            <input id="checkId-{dr[id]}" name="checkId" class="checkall" type="checkbox" value="{dr[id]}" >
            <label for="checkId-{dr[id]}">
              <h4><span>
              <%if({strtoint({dr[value]})}>0)%>
                +{dr[value]}
              <%else%>
                {dr[value]}
              <%/if%>
              </span>{dr[remark]}</h4>
              <p>{dr[add_time]}</p>
            </label>
          </li>
          <%/foreach%>
        </ul>
      </div>
      <input id="turl" type="hidden" value="<%linkurl("useramount","list")%>" /><!--存在跳转的URL值-->
      
      <!--分页页码-->
      <div class="page-list">{pagelist}</div>
      <!--/分页页码-->
      
      <!--版权信息-->
      <%template src="_copyright.html"%>
      <!--/版权信息-->
      
      <!--底部导航-->
      <footer>
        <a href="<%linkurl("useramount","recharge")%>" data-ignore="true" class="icon settings">账户充值</a>
        <a href="<%linkurl("useramount","log")%>" data-ignore="true" class="icon clock">充值记录</a>
        <a href="<%linkurl("useramount","list")%>" data-ignore="true" class="icon clock pressed">收支明细</a>
      </footer>
      <!--/底部导航-->
    <!--/收支明细-->
    <%/if%>
	</div>

    <!--左侧导航-->
    <%template src="_nav.html"%>
    <!--/左侧导航-->
      
  </div>
</div>
</body>
</html>
